<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Network Management System</title>

<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery-1.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/js/json2.js"></script>
<script type="text/javascript">
	alert("Begin ajax");
	var map = {"id":0,"name":"local","descript":"Remoting changed",
			"netInterfaces":[{"id":0,"name":"localNic1","descript":"Change from web",
				"ipAddress":"192.168.0.108","macAddress":null,"netNode":null,
				"netServices":[{"id":null,"name":"snmp","params":{"write":"private","read":"public","version":"2.0"},"netPoller":null}]}],
				"techInfo":{},"geoInfo":{"abc":"hehe"},"test":null};
	alert(JSON.stringify(map));
     $.ajax({
    	contentType : "application/json",
    	dataType : 'json',
    	type: 'POST',
        url: 'ajax/nodeService/update',
        data: JSON.stringify(map),
        success: function(data) {
          alert(data);
        },
        error:function(xhr,err){
            alert("responseText: "+xhr.responseText);
        }
      }); 
      //alert("Finished ajax");
  </script>
<script>
		var listNode = {};
		<c:forEach var="node" items="${nodeList}" varStatus="status">
		
		</c:forEach>
        function loadImages(sources, callback){
            var images = {};
            var loadedImages = 0;
            var numImages = 0;
            for (var src in sources) {
                numImages++;
            }
            for (var src in sources) {
                images[src] = new Image();
                images[src].onload = function(){
                    if (++loadedImages >= numImages) {
                        callback(images);
                    }
                };
                images[src].src = sources[src];
            }
        }
        
        window.onload = function(){
            var sources = {
                router1: "<%=request.getContextPath()%>/images/router.png",
                router2: "<%=request.getContextPath()%>/images/router.png",
				router3: "<%=request.getContextPath()%>/images/router.png"
		};
		loadImages(sources, initStage);
	};
</script>

<link href="<%=request.getContextPath()%>/css/c1.css" rel="stylesheet"
	type="text/css" />
</head>

<body>
	<div id="wrap">
		<div id="header"></div>
		<div id="menu">
			<table id="menu_ngang" width="1000" border="0">
				<tr>
					<td width="178" align="center"><strong><a
							href="user_management.jsp">USER MANAGEMENT</a> </strong>
					</td>
					<td width="202" align="center"><strong><a
							href="device_management.jsp">DEVICE MANAGEMENT</a> </strong>
					</td>
					<td width="204" align="center"><strong><a
							href="fault_management.jsp">FAULT MANAGEMENT</a> </strong>
					</td>
					<td width="173" align="left"><strong><a
							href="help.jsp">HELP</a> </strong>
					</td>
					<td width="147" align="center">&nbsp;</td>
				</tr>
			</table>
		</div>
		<div id="main">
			<div id="leftmain">

				<div
					style="display: none; position: absolute; padding: 10px; background-color: #ddd; border: 1px solid #000;"
					class="contextMenu" id="myMenu1">

					<ul>

						<li id="details"><img
							src="<%=request.getContextPath()%>/images/detail.png" width="16"
							height="16" /> Details</li>

						<li id="check"><img
							src="<%=request.getContextPath()%>/images/Check-icon.png"
							width="16" height="16" />Check device</li>

						<li id="detect"><img
							src="<%=request.getContextPath()%>/images/detect.png" width="16"
							height="16" /> Detect Faults</li>

						<li id="delete"><img
							src="<%=request.getContextPath()%>/images/cross.png" width="16"
							height="16" /> Delete</li>

					</ul>
				</div>
			</div>
			<div id="rightmain">

				<div id="list">
					Device:
					<ul>

						<li id="details"><img
							src="<%=request.getContextPath()%>/images/detail.png" width="16"
							height="16" /> Details</li>

						<li id="check"><img
							src="<%=request.getContextPath()%>/images/Check-icon.png"
							width="16" height="16" />Check device</li>

						<li id="detect"><img
							src="<%=request.getContextPath()%>/images/detect.png" width="16"
							height="16" /> Detect Faults</li>

						<li id="delete"><img
							src="<%=request.getContextPath()%>/images/cross.png" width="16"
							height="16" /> Delete</li>

					</ul>
				</div>
				<div id="timkiem"></div>
				<div id="quangcao"></div>
			</div>
			<div class="container" id="container"></div>
		</div>

		<div id="footer">
			<strong>LUẬN VĂN TỐT NGHIỆP - KHOA MẠNG MÁY TÍNH
				VÀ TRYỀN THÔNG</strong>
			<p>
				<strong><span class="foot">© 2012</span> </strong>
			</p>
		</div>
	</div>

</body>
</html>

